var num ='500050'
const arr = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']
const arr1 = ['','十', '百', '千', '万', '十', '百', '千', '亿', '十']
const numarr=num.split('').reverse()
var newNum=''
const strArr=[]
    numarr.forEach((m,n)=>{
        strArr.unshift(m==0?arr[m]:arr[m]+arr1[n])

    })
    console.log(strArr); 
    for (let m = 0; m < strArr.length; m++) {
        for (let n = 0; n < strArr.length; n++) {
            if (strArr[n]=='零'&&strArr[m-n]=='零') {
                strArr.splice(n,1)
                console.log(strArr);
            }
            if (strArr[strArr.length-1]=='零') {
                strArr.pop()
            }
        }
    }
    console.log(strArr);
    